#include "stdlib.h"
#include "stdio.h"
#include "string.h"

//结构体的定义
typedef struct _AdvTeacher
{
	char *name;
	char buf[100];
	int age;
}Teacher ;


Teacher * creatT()
{
	Teacher *tmp = NULL;
	tmp = (Teacher *)malloc(sizeof(Teacher));
	tmp->name = (char *)malloc(100);
	return tmp;
}

void FreeT(Teacher *t)
{
	if (t == NULL)
	{
		return ;
	}
	if (t->name != NULL)
	{
		free(t->name);
	}
}

void main()
{
	Teacher *t1;

	t1 = CreatT();
	if(t1 == NULL){
		printf("CreatT() error")
		return;
	}
	FreeT(t1 );
	


	system("pause");
}
	


